<?php

namespace app\admin\model;

use think\Model;


class BydTixianSet extends Model
{

    

    

    // 表名
    protected $name = 'byd_tixian_set';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'state_text'
    ];

    public function getmode()
    {
        return ['0' => __('微信'), '1' => __('银行卡')];
    }
    
    public function getStateList()
    {
        return ['0' => __('自动'), '1' => __('手动')];
    }


    public function getStateTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['state']) ? $data['state'] : '');
        $list = $this->getStateList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
